<template>
    <div>
        <Banner :bannerData="bannerData" v-if="bannerData"></Banner>
    </div>
</template>

<script setup>
import { inject, ref } from 'vue'
const $root = inject('$root')
const $axios = inject('$axios')
let bannerData = ref([])
//获取广告栏数据
const getBannerData = () => {
    $axios.get($root + `/banner/get/`).then(bannerRes => {
        bannerData.value = bannerRes.data.data
    })
}
getBannerData()
</script>